import { createWebHistory, createRouter } from 'vue-router'
//导入要配置的组件
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Shop from "../views/Shop.vue"
import Xq from "../views/Xq.vue"

//配置路径规则
const routes = [
  { path: '/', component: Home },
  { path: '/login', component: Login },
  { path: '/Shop', component: Shop },
  { path: '/Xq/:id', component: Xq },
]

//调用创建路由的函数
const router = createRouter({
  history:createWebHistory(),
  routes,
})

//配置完成后导出router
export default router
